<template>
    <page-body>
        <view class="page">
            <view class="flex align-stretch benben-position-layout flex sqRefund_flex_0" :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
                <view class='flex align-center justify-between flex-sub sqRefund_fd0_0'>
                    <view class='flex align-center sqRefund_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
                        <text class='fu-iconfont2  sqRefund_fd0_0_c0_c0'>&#xE794;</text>
                    </view>
                    <view class='flex align-center'>
                        <text class='sqRefund_fd0_0_c1_c0'>申请退款</text>
                    </view>
                    <view class='flex align-center sqRefund_fd0_0_c0'>
                    </view>
                </view>

            </view>
            <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
            <!---flex布局flex布局开始-->
            <view class="flex benben-flex-layout flex-wrap align-center sqRefund_flex_1">
            </view>

            <!---flex布局flex布局结束-->
            <!---flex布局flex布局开始-->
            <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout sqRefund_flex_2">
                <view class='flex flex-wrap align-center sqRefund_fd2_0' @tap.stop="popupShow1716004188390=true">
                    <text class='sqRefund_fd2_0_c0'>退款类型</text>
                    <benben-input class='flex-sub sqRefund_fd2_0_c1' type="text" :placeholder="`请选择`" confirm-type="done" :maxlength="-1" 
					:adjust-position='true' placeholder-style="color:#999;font-size:32rpx" v-model="tk_name" :disabled="true" />
                    <image class='sqRefund_fd2_0_c2' mode="aspectFit" :src='STATIC_URL+"38.png"'></image>
                </view>
                <view class='flex flex-wrap align-center sqRefund_fd2_0' @tap.stop="popupShow1716002269216=true">
                    <text class='sqRefund_fd2_0_c0'>退款原因</text>
                    <benben-input class='flex-sub sqRefund_fd2_0_c1' type="text" :placeholder="`请选择退款原因`" confirm-type="done" :maxlength="-1" 
					:adjust-position='true' placeholder-style="color:#999;font-size:32rpx" v-model="refund_name" :disabled="true" />
                    <image class='sqRefund_fd2_0_c2' mode="aspectFit" :src='STATIC_URL+"38.png"'></image>
                </view>
                <text class='sqRefund_fd2_2'>退款说明</text>
                <view class='flex flex-wrap sqRefund_fd2_3'>
                    <textarea class='flex sqRefund_input_fd2_3' :placeholder="'若需退款，请务必上传相关照片，将于当日统一处理'" :adjust-position='true' :maxlength="800" :show-num='true' placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx" v-model="input1" />
                    <!-- <template>
                        <view class='flex flex justify-end sqRefund_numberfd2_3_c0'>
                            <text class='sqRefund_numberfd2_3_c0_c0'>{{input1.length}}</text>
                            <text class='sqRefund_numberfd2_3_c0_c0'>/</text>
                            <text class='sqRefund_numberfd2_3_c0_c0'>800</text>
                        </view>
                    </template> -->
                </view>
				<view class="">
					
					
					
					<benben-images-upload ref="benbenImagesUploadfd2_4" :img-list.sync="input2" :img-ids.sync="fd3_1_c1id" :is-show-tips='true' :maxlength="9">
					                   <template #content="{ num, maxlength, isShow, imgList }">
					                       <view class="flex flex-wrap align-start flex">
					
					                           <view v-for="(image, index) in input2" :key="index" class='flex position-relative sqRefund_fd2_40'>
					                               <text class='fu-iconfont2 position-absolute sqRefund_fd2_400' @tap.stop="$refs.benbenImagesUploadfd2_4.delImage(index)">&#xE8E7;</text>
					                               <image class='sqRefund_fd2_401' @tap.stop="$refs.benbenImagesUploadfd2_4.previewImage(index)" mode="aspectFill" :src='image'></image>
					                           </view>
					
					                           <image class='sqRefund_fd2_41' @tap.stop="$refs.benbenImagesUploadfd2_4.manyChooseImage()" v-if="input2.length < 9" mode="aspectFit" :src='STATIC_URL+"34.png"'></image>
					<text class='image_upload_tips Rzrider_fd2_0_c5_c12' style="color: rgba(0, 0, 0, 0);">{{maxlength}}退款售后必须上传拍照图片</text>
					                       </view>
					                   </template>
					               </benben-images-upload>
				</view>
                
            </view>

            <!---flex布局flex布局结束-->
            <benben-popup v-model="popupShow1716005173718" :mask="true" :mask-close-able="true" mode='center' :z-index='20'>
                <!---积分规则弹窗flex布局开始-->
                <view class="flex flex-direction flex-wrap align-center benben-flex-layout">
                    <view class='flex flex-direction flex-wrap align-center sqRefund_fd3_0'>
                        <text class='sqRefund_fd3_0_c0'>全部退款说明</text>

                        <scroll-view class='sqRefund_fd3_0_c1' :scroll-y='true' :show-scrollbar='true'>
                            <view class='flex benben-scroll flex align-center'>
                                <jyf-parser class='sqRefund_fd3_0_c1_c0' :html="shuoming | richTextFormat">
                                </jyf-parser>
                            </view>
                        </scroll-view>

                    </view>
                    <image class='sqRefund_fd3_1' mode="aspectFit" :src='STATIC_URL+"138.png"' @tap.stop="popupShow1716005173718=false"></image>
                </view>

                <!---积分规则弹窗flex布局结束-->

            </benben-popup>
            <benben-popup v-model="popupShow1716002269216" :mask="true" :mask-close-able="true" mode='bottom'>
                <!---退款原因弹窗flex布局开始-->
                <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout sqRefund_flex_4">
                    <view class='flex flex-wrap align-center justify-between sqRefund_fd4_0'>
                        <text class='sqRefund_fd4_0_c0' @tap.stop="popupShow1716002269216=false">取消</text>
                        <text class='sqRefund_fd4_0_c1'>退款原因</text>
                        <text class='sqRefund_fd4_0_c2' @tap.stop="popupShow1716002269216=false">确定</text>
                    </view>
                    <text class='sqRefund_fd4_1'>请选择退款原因</text>
                    <benben-select-diy ref="showSelectPopup1716002823756" class-name='flex flex-direction align-stretch flex sqRefund_fd4_2' 
					:items.sync="lsit" v-model="refund_id" :label.sync="refund_name" default-type="aid" default-label="title" :allow-cancel='false' type="radio" :disabled='false'>
                        <template v-for='(item,key0) in lsit'>
                            <view v-if="item.isSelected" class='flex align-center justify-between flex sqRefund_fd4_2_c0' :key="key0" @tap="$refs.showSelectPopup1716002823756.tapHandle(key0)">
                                <text class='sqRefund_fd4_2_c0_c0'>{{item.title}}</text>
                                <image class='sqRefund_fd4_2_c0_c1' mode="aspectFit" :src='STATIC_URL+"2.png"'></image>
                            </view>
                            <view v-else class='flex align-center justify-between flex sqRefund_fd4_2_c0' :key="key0" @tap="$refs.showSelectPopup1716002823756.tapHandle(key0)">
                                <text class='sqRefund_fd4_2_c0_c0'>{{item.title}}</text>
                                <image class='sqRefund_fd4_2_c0_c1' mode="aspectFit" :src='STATIC_URL+"3.png"'></image>
                            </view>
                        </template>
                    </benben-select-diy>
                </view>

                <!---退款原因弹窗flex布局结束-->

            </benben-popup>
            <benben-popup v-model="popupShow1716004188390" :mask="true" :mask-close-able="true" mode='bottom' :z-index='19'>
                <!---退款类型弹窗flex布局开始-->
                <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout sqRefund_flex_5">
                    <view class='flex flex-wrap align-center justify-between sqRefund_fd5_0'>
                        <text class='sqRefund_fd5_0_c0' @tap.stop="popupShow1716004188390=false">取消</text>
                        <text class='sqRefund_fd5_0_c1'>请选择退款类型</text>
                        <text class='sqRefund_fd5_0_c2' @tap.stop="popupShow1716004188390=false">确定</text>
                    </view>
                    <benben-select-diy ref="showSelectPopup1716004634845" class-name='flex flex-direction align-stretch flex sqRefund_fd5_1' 
					:items.sync="refundType" v-model="tk_id" :label.sync="tk_name" default-type="aid" default-label="type_name" :allow-cancel='false' type="radio" :disabled='false'>
                        <template v-for='(item,key0) in refundType'>
                            <view v-if="item.isSelected" class='flex align-center flex sqRefund_fd5_1_c0' :key="key0" @tap="$refs.showSelectPopup1716004634845.tapHandle(key0)">
                                <text class='sqRefund_fd5_1_c0_c0'>{{item.type_name}}</text>
                                <image class='sqRefund_fd5_1_c0_c1' mode="aspectFit" :src='STATIC_URL+"66.png"' @tap.stop="tankuangFunc(item.remark)" v-if=" item.aid=='3'"></image>
                                <image class='sqRefund_fd5_1_c0_c2' mode="aspectFit" :src='STATIC_URL+"2.png"'></image>
                            </view>
                            <view v-else class='flex align-center flex sqRefund_fd5_1_c0' :key="key0" @tap="$refs.showSelectPopup1716004634845.tapHandle(key0)">
                                <text class='sqRefund_fd5_1_c0_c0'>{{item.type_name}}</text>
                                <image class='sqRefund_fd5_1_c0_c1' mode="aspectFit" :src='STATIC_URL+"66.png"' @tap.stop="tankuangFunc(item.remark)" v-if=" item.aid=='3'"></image>
                                <image class='sqRefund_fd5_1_c0_c2' mode="aspectFit" :src='STATIC_URL+"3.png"'></image>
                            </view>
                        </template>
                    </benben-select-diy>
                </view>

                <!---退款类型弹窗flex布局结束-->

            </benben-popup>
            <view class="flex flex-wrap align-start justify-center benben-position-layout flex sqRefund_flex_6">
                <button class='sqRefund_fd6_0' @tap.stop="getbl46834d200f42Func()">提交</button>

            </view>
            <view :style="{height: '120rpx'}"></view>


        </view>
    </page-body>
</template>
<script>
    import {
        validate
    } from '@/common/utils/validate.js'

    export default {
        components: {},


        data() {
            return {
				"fd3_1_c1": [],
				"fd3_1_c1id": "",
                "popupShow1716004188390": false,
                "popupShow1716002269216": false,
                "popupShow1716005173718": false,
                "refundType": [],
                "refund_id": "",
                "tkTypes": [{
                    "name": "全部退款",
                    "value": "1",
                    "image": ""
                }, {
                    "name": "部分退款",
                    "value": "2",
                    "image": ""
                }],
                "tk_id": "1",
                "lsit": [],
                "tk_name": "",
                "shuoming": "",
                "refund_name": "",
                "input1": "",
                "input2": [],
                "order_sn": "",
                "type": ""
            };
        },
        computed: {

        },
        watch: {},
        onLoad(options) {
            let {
                order_sn,
                type
            } = options
            if (order_sn !== undefined) this.order_sn = order_sn
            if (type !== undefined) this.type = type
            this.getcm6729eb8145b2Func()
            this.getcv4683f2312dbaFunc()
        },
        onUnload() {

        },
        onReady() {

        },
        onShow() {

        },
        onHide() {

        },
        onResize() {

        },
        onPullDownRefresh() {

        },
        onReachBottom(e) {

        },
        onPageScroll(e) {

        },
        methods: {
            //获取售后类型/退款类型（外卖订单/跑腿订单）
            async getcm6729eb8145b2Func() {
                //请求方法
                //数据验证

                let datarefundType = await this.$api.get(global.apiUrls.post66729eb8145b2, {
                    order_type: this.type
                });

                if (datarefundType.data.code != 1) {
                    this.$message.info(datarefundType.data.msg);
                    return
                }
                let inforefundType = datarefundType.data;
                this.refundType = inforefundType.data

            },
            //原因弹框
            tankuangFunc(name) {
                this.shuoming = name;
                this.popupShow1716005173718 = true;
            },
            //查询售后原因
            async getcv4683f2312dbaFunc() {
                //请求方法
                //数据验证

                let datalsit = await this.$api.get(global.apiUrls.post64683f2312dba, {
                    order_type: this.type
                });

                if (datalsit.data.code != 1) {
                    this.$message.info(datalsit.data.msg);
                    return
                }
                let infolsit = datalsit.data;
                this.lsit = infolsit.data

            },
            //订单售后申请
            async getbl46834d200f42Func() {
                if (!validate(this.tk_id, 'require')) {
                    this.$message.info('请选择退款类型');
                    return false;
                }
                if (!validate(this.refund_id, 'require')) {
                    this.$message.info('请选择退款原因');
                    return false;
                }
				if(!this.input1){
					this.$message.info('请填写退款说明');
					return false;
				}
                //请求方法
                //数据验证

                let data646834d200f42 = await this.$api.post(global.apiUrls.post646834d200f42, {
                    order_sn: this.order_sn,
                    refund_reason: this.refund_name,
                    refund_picture: this.input2.toString(),
                    refund_content: this.input1,
                    refund_type: this.tk_name,
                    order_type: this.type
                });

                if (data646834d200f42.data.code != 1) {
                    this.$message.info(data646834d200f42.data.msg);
                    return
                }
                let info646834d200f42 = data646834d200f42.data;


                uni.showToast({
                    title: '申请成功',
                    mask: true,
                    icon: 'none',
                    duration: 1500
                });
                setTimeout(() => {
                    this.$urouter.navigateBack(1);
                }, 500)
            }
        }
    };
</script>
<style lang="scss" scoped>
    .page {
        width: 100vw;
        overflow-x: hidden;
        min-height: calc(100vh - var(--window-bottom));
        background: #fff;
        background-size: 100% auto;
    }

    .sqRefund_flex_0 {
        background: #fff;
        width: 750rpx;
        height: 88rpx;
        overflow: hidden;
        z-index: 10;
        top: 0rpx;
        background-size: 100% auto !important;
    }

    .sqRefund_fd0_0_c1_c0 {
        font-size: 36rpx;
        font-weight: 500;
        color: #333;
    }

    .sqRefund_fd0_0_c0_c0 {
        font-size: 32rpx;
        font-weight: 500;
        color: #333;
    }

    .sqRefund_fd0_0_c0 {
        width: 180rpx;
    }

    .sqRefund_fd0_0 {
        padding: 0rpx 32rpx 0rpx 32rpx;
        line-height: 88rpx;
    }

    .sqRefund_flex_1 {
        background: rgba(246, 247, 249, 1);
        height: 20rpx;
        background-size: 100% auto;
    }

    .sqRefund_flex_2 {
        padding: 0rpx 32rpx 0rpx 32rpx;
    }

    .sqRefund_fd2_41 {
        width: 180rpx;
        height: 180rpx;
        margin: 0rpx 24rpx 24rpx 0rpx;
        border-radius: 16rpx;
    }

    .sqRefund_fd2_401 {
        width: 180rpx;
        height: 180rpx;
        border-radius: 16rpx;
    }

    .sqRefund_fd2_400 {
        top: 0rpx;
        right: 0rpx;
        z-index: 10;
        color: #ff5536;
    }

    .sqRefund_fd2_40 {
        margin: 0rpx 24rpx 24rpx 0rpx;
    }

    .sqRefund_numberfd2_3_c0_c0 {
        color: #8E8E93;
        font-size: 24rpx;
        font-weight: 400;
        line-height: 33rpx;
    }

    .sqRefund_numberfd2_3_c0 {
        width: 100%;
        font-size: 24rpx;
        color: #FFFFFF;
        line-height: 46rpx;
        font-weight: 400;
    }

    .sqRefund_input_fd2_3 {
        width: 100%;
        height: 260rpx;
        font-size: 28rpx;
        font-weight: 400;
        color: #333;
        white-space: pre-wrap;
    }

    .sqRefund_fd2_3 {
        background: rgba(246, 247, 249, 1);
        border-radius: 10rpx 10rpx 10rpx 10rpx;
        padding: 24rpx 24rpx 24rpx 24rpx;
        margin: 0rpx 0rpx 20rpx 0rpx;
    }

    .sqRefund_fd2_2 {
        color: #333333;
        font-size: 32rpx;
        font-weight: 500;
        line-height: 45rpx;
        margin: 32rpx 0rpx 32rpx 0rpx;
    }

    .sqRefund_fd2_0_c2 {
        width: 12rpx;
        height: 22rpx;
        margin: 0rpx 0rpx 0rpx 22rpx;
    }

    .sqRefund_fd2_0_c1 {
        text-align: right;
        margin: 0rpx 0rpx 0rpx 24rpx;
        font-size: 32rpx;
        font-weight: 400;
        color: #333;
    }

    .sqRefund_fd2_0_c0 {
        color: #333333;
        font-size: 32rpx;
        font-weight: 500;
        line-height: 45rpx;
        text-align: left;
        font-style: normal;
    }

    .sqRefund_fd2_0 {
        border-bottom: 1px solid #eee;
        padding: 32rpx 0rpx 32rpx 0rpx;
    }

    .sqRefund_fd3_1 {
        width: 55rpx;
        height: 55rpx;
        border-radius: 0rpx 0rpx 0rpx 0rpx;
    }

    ::v-deep .sqRefund_fd3_0_c1_c0 {
        width: 100%;
    }

    .sqRefund_fd3_0_c1 {
        touch-action: none;
        padding: 0rpx 32rpx 0rpx 32rpx;
        margin: 0rpx 0rpx 28rpx 0rpx;
    }

    .sqRefund_fd3_0_c0 {
        font-size: 32rpx;
        font-weight: 500;
        color: #333333;
        margin: 0rpx 0rpx 32rpx 0rpx;
        line-height: 45rpx;
    }

    .sqRefund_fd3_0 {
        background: #fff;
        width: 540rpx;
        background-size: 100% auto !important;
        border-radius: 24rpx 24rpx 24rpx 24rpx;
        padding: 40rpx 0rpx 0rpx 0rpx;
        margin: 0rpx 0rpx 40rpx 0rpx;
    }

    .sqRefund_flex_4 {
        background: #fff;
        background-size: 100% auto !important;
        border-radius: 24rpx 24rpx 0rpx 0rpx;
        padding: 0rpx 0rpx 17rpx 0rpx;
    }

    .sqRefund_fd4_2_c0_c1 {
        width: 36rpx;
        height: 36rpx;
    }

    .sqRefund_fd4_2_c0_c0 {
        line-height: 45rpx;
        font-size: 32rpx;
        font-weight: 400;
        color: #333333;
    }

    .sqRefund_fd4_2_c0 {
        margin: 0rpx 0rpx 40rpx 0rpx;
    }

    ::v-deep .sqRefund_fd4_2 {
        padding: 40rpx 24rpx 0rpx 24rpx;
    }

    .sqRefund_fd4_1 {
        background: rgba(246, 247, 249, 1);
        padding: 0rpx 24rpx 0rpx 24rpx;
        line-height: 90rpx;
        font-size: 28rpx;
        font-weight: 400;
        color: #666666;
        background-size: 100% auto !important;
    }

    .sqRefund_fd4_0_c2 {
        line-height: 45rpx;
        font-size: 32rpx;
        font-weight: 400;
        color: var(--benbenFontColor4);
    }

    .sqRefund_fd4_0_c1 {
        line-height: 50rpx;
        font-size: 36rpx;
        font-weight: 700;
        color: #333333;
    }

    .sqRefund_fd4_0_c0 {
        line-height: 45rpx;
        font-size: 32rpx;
        font-weight: 400;
        color: #999999;
    }

    .sqRefund_fd4_0 {
        height: 114rpx;
        padding: 0rpx 24rpx 0rpx 24rpx;
    }

    .sqRefund_flex_5 {
        background: #fff;
        background-size: 100% auto !important;
        border-radius: 24rpx 24rpx 0rpx 0rpx;
        padding: 0rpx 0rpx 17rpx 0rpx;
    }

    .sqRefund_fd5_1_c0_c2 {
        width: 36rpx;
        height: 36rpx;
        margin: 0rpx 0rpx 0rpx auto;
    }

    .sqRefund_fd5_1_c0_c1 {
        width: 24rpx;
        height: 24rpx;
        margin: 0rpx 0rpx 0rpx 24rpx;
    }

    .sqRefund_fd5_1_c0_c0 {
        line-height: 45rpx;
        font-size: 32rpx;
        font-weight: 400;
        color: #333333;
    }

    .sqRefund_fd5_1_c0 {
        margin: 0rpx 0rpx 40rpx 0rpx;
    }

    ::v-deep .sqRefund_fd5_1 {
        padding: 0rpx 24rpx 0rpx 24rpx;
    }

    .sqRefund_fd5_0_c2 {
        line-height: 45rpx;
        font-size: 32rpx;
        font-weight: 400;
        color: var(--benbenFontColor4);
    }

    .sqRefund_fd5_0_c1 {
        line-height: 50rpx;
        font-size: 36rpx;
        font-weight: 700;
        color: #333333;
    }

    .sqRefund_fd5_0_c0 {
        line-height: 45rpx;
        font-size: 32rpx;
        font-weight: 400;
        color: #999999;
    }

    .sqRefund_fd5_0 {
        padding: 0rpx 24rpx 0rpx 24rpx;
        margin: 32rpx 0rpx 50rpx 0rpx;
    }

    .sqRefund_flex_6 {
        width: 750rpx;
        height: 120rpx;
        overflow: hidden;
        z-index: 10;
        bottom: calc(0rpx + var(--window-bottom));
    }

    .sqRefund_fd6_0 {
        background: #FF8E21;
        border-radius: 44rpx 44rpx 44rpx 44rpx;
        width: 686rpx;
        line-height: 80rpx;
        font-size: 32rpx;
        color: #fff;
        height: 80rpx;
    }
</style>